<template>
    <div class="topIndex">
      <div>
        <van-image round width="1rem" height="1rem" :src="obj.aut_photo" />
      </div>
      <div class="right">
        <div class="rightbox">
          <span class="uname">{{ obj.aut_name }}</span>
          <van-button icon="plus" type="info" size="mini" plain v-if='showKey===2'>关注</van-button>
        </div>
        <div class="rightbox marginTop">
          {{ obj.content }}
        </div>
        <div class="rightbox marginTop ">
          <span class="timeSize">{{ obj.pubdate }}</span>
          <div @click="changeShowFn" :class="{wz:showKey===1}">
            <van-icon v-if="goodShow" name="good-job-o" class="goodJob"/>
            <van-icon v-else name="good-job"  class="goodJob red"/>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
export default {
  props: ['obj', 'showKey'],
  data () {
    return {
      goodShow: true
    }
  },
  methods: {
    changeShowFn () {
      this.goodShow = !this.goodShow
    }
  },
  created () {
  }
}

</script>

<style lang="less" scoped>
.wz{
  transform:translateY(-10px);
}
.topIndex{
  display: flex;
  padding:10px 16px;
  border-bottom: 1px solid #ebedf0;
  .left{
    width: 37.5px;
  }
  .right{
    flex: 1;
    padding-left: 10px;
  }
  .rightbox{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;

  }
  .timeSize{
    color: #666;
    font-size: 10px;
  }
  .marginTop{
    margin-top:10px ;
  }
}
.goodJob{
  font-size: 25px;
    color: #666;
  margin-left: 8px;
}
.red{
  color: red;
}
</style>
